
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:transparent_image/transparent_image.dart';

class ImgApp extends StatelessWidget{

  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'web images',
      home: new Scaffold(
        appBar: new AppBar(
          title: new Text('web img'),
        ),
        body: new Column(
          mainAxisAlignment: MainAxisAlignment.spaceEvenly,
          mainAxisSize: MainAxisSize.min,
          children: <Widget>[
            new Row(
              children: <Widget>[
                  new Expanded(
                      child: new Stack(
                        children: <Widget>[
                          new Center(
                            child: new CircularProgressIndicator(),
                          ),
                          new Center(
                            child: new FadeInImage.memoryNetwork(
                                placeholder: kTransparentImage,
                                fadeInDuration: new Duration(milliseconds: 100),
                                image: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1586175582175&di=55f582d178546085cc7a08df171780c9&imgtype=0&src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201807%2F31%2F20180731094225_rsqri.jpg'
                            ),
                          )
                        ],
                      ),
                  ),
              ]
            ),
            new Row(
              children: <Widget>[
                new Expanded(
                    child: new Center(
                         child:new CachedNetworkImage(
                         imageUrl: 'http://via.placeholder.com/350x150',
                         placeholder: (context, url) => CircularProgressIndicator(),
                    )
                ),
              )
            ],
          ),
          ]
        ),
      ),
    );
  }
}

//https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1586175582175&di=55f582d178546085cc7a08df171780c9&imgtype=0&src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201807%2F31%2F20180731094225_rsqri.jpg